package com.ctbri.vSearch.util;

/**
 * Created by xuexi on 2017/5/3.
 */
public class CategoryStr2Int {

    public static int getCategory(String category) {
        if(category==null||category.equals("")){
            return 0;
        }
        if(category.equals("person")){
            return 1;
        }else if(category.equals("location")){
            return 2;
        }else if(category.equals("institution")){
            return 3;
        }else if(category.equals("tech")){
            return 4;
        }else {
            return 5;
        }


    }

    public static String getCategory(int category) {
        if(category==0){
            return "";
        }
        if(category == 1){
            return  "person";
        }else if(category == 2){
            return  "location";
        }else if(category == 3){
            return  "institution";
        }else if(category == 4){
            return  "tech";
        }else {
            return  "";
        }


    }

}
